// 全局过滤器
import Vue from 'vue'
import {transformNumber} from '../utils/util'

Vue.filter('formatDateTime',(dt)=>{
  const d = new Date(dt)
  const year = d.getFullYear()
  const mon = transformNumber(d.getMonth()+1,2)
  const day = transformNumber(d.getDate(),2)
  const hr = transformNumber(d.getHours(),2)
  const min = transformNumber(d.getMinutes(),2)
  const sec = transformNumber(d.getSeconds(),2)
  return `${year}-${mon}-${day} ${hr}:${min}:${sec}`
})